package com.richard.library.http.model;

import java.io.Serializable;


/**
 * <pre>
 * Description : 上传文件的携带信息
 * Author : admin-richard
 * Date : 2019-05-27 08:28
 * Changelog:
 * Version            Date            Author              Detail
 * ----------------------------------------------------------------------
 * 1.0         2019-05-27 08:28     admin-richard         new file.
 * </pre>
 */
public class UploadFileModel implements Serializable {

    private static final long serialVersionUID = -6228297591333508623L;

    /**
     * 上传文件接口对应的name
     */
    private String name;

    /**
     * 文件路径或者url
     */
    private String filePath;

    /**
     * mine类型
     */
    private String mineType = "";

    public UploadFileModel() {
    }

    public UploadFileModel(String name, String filePath, String mineType) {
        this.name = name;
        this.filePath = filePath;
        this.mineType = mineType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public String getMineType() {
        return mineType;
    }

    public void setMineType(String mineType) {
        this.mineType = mineType;
    }

    //-----------------------自定义方法-----------------------

    public boolean isImage() {
        if (mineType == null) return false;
        return mineType.startsWith("image");
    }

    public boolean isVideo() {
        if (mineType == null) return false;
        return mineType.startsWith("video");
    }
}
